<template>
  <div>
    <el-table
    height="600"
    ref="multipleTable"
    :data="userDate"
    tooltip-effect="dark"
    style="width: 100%"
    @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="50"> </el-table-column>
      <el-table-column header-align="center" align="center" label="患者姓名" width="100" prop="name">
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="card" label="就诊卡号" width="120">
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="idCard" label="身份证号" show-overflow-tooltip>
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="phone" label="手机号码" show-overflow-tooltip>
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="keshi" label="挂号科室" show-overflow-tooltip>
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="leixing" label="挂号类型" width="80px" show-overflow-tooltip>
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="price" label="挂号费" width="80px" show-overflow-tooltip>
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="zhuangtai" label="挂号状态" width="80px" show-overflow-tooltip>
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="date" label="就诊日期" show-overflow-tooltip>
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="time" label="候诊时间" show-overflow-tooltip>
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="yuyue" label="预约时间" show-overflow-tooltip>
      </el-table-column>
      <el-table-column header-align="center" align="center" prop="address" label="操作" show-overflow-tooltip>
        <el-button type="primary" icon="el-icon-edit" circle></el-button>
        <el-button type="danger" icon="el-icon-delete" circle></el-button>
      </el-table-column>
    </el-table>
    
  </div>
</template>

<script>
import { getAdminApiYs } from "@/api/adminApi/adminApiYs";
export default {
  data(){
    return{
      page: 1,
      userDate: [],
    }
  },
  methods:{
    toggleSelection(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    handleSelectionChange(val) {
        this.multipleSelection = val;
    },
  },
  async mounted() {
    let ret = await getAdminApiYs(this.page)
    if(ret.data.length > 0) {
      this.userDate = ret.data
      
    }else{
        this.$message.error('没有更多数据了')
    }
    
    
  }
}
</script>

<style lang="scss" scoped>
.el-button.is-circle{
  transform: scale(0.7);
}
  
  

</style>